package com.ys.web.user.risk;

import com.ys.base.BaseDao;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface RiskMapper extends BaseDao {
    @Insert("insert into user_risk(user_id,remark) values(#{userId},#{remark})")
    void saveRisk(Risk risk);

    List<Risk> getRiskList(Risk risk);

    @Update("update user_risk set status=2 where user_id=#{userId}")
    int updateRisk(Risk risk);

    List<RiskListInfo> getRiskListInfo(@Param("param") RiskVo riskVo);

    int getRiskListCount(@Param("param") RiskVo riskVo);

    @Select("select * from user_risk where user_id = #{uid} and `status` = 1 ")
    Risk selectByUserId(@Param("uid") long uid);

    @Select("select count(0) from user_withdraw_black where user_id = #{uid}")
    int userWithdrawCount(@Param("uid") long uid);
}
